import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from "../views/Index";

Vue.use(VueRouter)

const routes = [
    {path: '/', redirect: "/login"},
    {
        path: '/index', name: "Index", component: Index, children: [
            {path: "flower", component: () => import('../components/flower/FlowerTable')},
            {path: "flowerAdd", component: () => import('../components/flower/Form')},
            {path: "section", component: () => import('../components/section/SectionTable')},
            {path: "home", component: () => import('../components/homePage/homepage')},
            {path: "model", component: () => import('../components/description/DescriptionTable')},
            {path: "manager", component: () => import('../components/manager/mangerTable')},
            {path: "order", component: () => import('../components/order/index')},
            {path: "role",component:()=>import('../components/role/role')},
            {path: "setAuth",component:()=>import('../components/role/setAuth')},
            {path: "menu",component:()=>import('../components/menu/menu')},
            {path: "user",component:()=>import('../components/user/userManager')},
            {path: "table",component:()=>import('../components/table/desktop')}
        ]
    },
    {
        path: '/login', name: "Login", component:()=>import("../views/Login")
    },
    {
        path: '*', name: "404", component:()=>import("../views/Not_Find")
    }
]

const router = new VueRouter({
    mode: 'history',
    routes
})

export default router
